Integrating Specification and Documentation in an Object-Oriented Language

نویسندگان

  • Jie Liang
  • Emil Sekerinski
چکیده

class Shape protected attr x, y : integer; public abstract method boundingBox : Rectangle; public method area : integer return 0 public method move (dx, dy : integer) begin x : = x + dx; y := y + dy end initialization(x, y : integer) begin self.x := x; self.y := y end end class Rectangle inherit Shape protected attr w, h : integer; public method boundingBox : Rectangle return new Rectangle(x, y, w, h) public method area : integer return w * h initialization(x, y, w, h : integer) begin super.initialization(x, y); self.w := w; self.h := h end end class Polygon extend Rectangle implement Shape protected attr i, n : integer; attr Xs : array of integer; attr Ys : array of integer; invariant n > 0 initialization(Xs, Ys : array of integer, n: integer) begin self.n := n; x := Xs[0]; y := Ys[0]; w := (MAX i | 0 ≤ i < n •Xs[i])− (MIN i | 0 ≤ i < n •Xs[i]); h := (MAX i | 0 ≤ i < n • Y s[i])− (MIN i | 0 ≤ i < n • Y s[i]); i : = 0; while i < n-1 do self.Xs[i], self.Ys[i] := Xs[i+1], Ys[i+1]; end public method move (dx, dy : integer) post ∀ i | 0 ≤ i < n− 1 • (dx = old Xs[i] Xs[i]) ∧ (dy = old Ys[i] -Ys[i]) begin super.move(dx, dy); i := 0; while i < n 1 do Xs[i], Ys[i] := Xs[i] dx, Ys[i] dy end public method area : integer ... end end 4. DOCUMENTATION GENERATION Lime’s support for automatic documentation generation was influenced by early work on literate programming and documentation system like Javadoc and Doxygen. Both Javadoc and Doxygen generate on-line interface documentation in HTML format. The design for LimeD is along those lines: • LimeD generates documentation directly from the source code; • LimeD provides a behavioral interface specification, not only a syntactic interface; • LimeD shows the subclass and subtype hierarchies. For a project, LimeD generates a summary page and a page for each individual class. For quickly accessing class documentation, a list with linked indices for all classes is generated and acts as a navigation menu. The documentation of each individual class starts with the class description extracted from the documentation comment in the source file. Documentation comments can contain embedded HTML code. The document may contain the following parts: • Class Invariant with the invariant defined in the current class and the invariants inherited from all supertypes. The inherited invariants are conjoined to generate a single expression. All the information is extracted from the current class and from the Java class files of all supertypes. • Class Hierarchy displayed graphically; Lime supports single subclassing. • Type Hierarchy presented as an indented list; Lime supports multiple subclassing. • Attribute with all non-private attributes defined in the current class. • Inherited Attribute with all attributes inherited from superclasses and supertypes. • Method contains all methods defined in the current class. It gives the method signature and the precondition and postcondition defined in the current class. If the method redefines or implements a method of a supertype, it also gives the precondition and postcondition defined in supertypes. These are extracted from the Java class files of all supertypes. • Inherited Method contains all inherited methods. It gives the method signature, precondition and postcondition.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Declarative Semantics in Object-Oriented Software Development - A Taxonomy and Survey

One of the modern paradigms to develop an application is object oriented analysis and design. In this paradigm, there are several objects and each object plays some specific roles in applications. In an application, we must distinguish between procedural semantics and declarative semantics for their implementation in a specific programming language. For the procedural semantics, we can write a ...

متن کامل

Querying Framework Documentation

In this paper we discuss about the combination of to powerful tools for documenting object oriented frameworks: hypermedia navigational models and hypermedia queries. We also present a way for translating queries performed on top of framework documentation applications, into XML representations, as a way for exchanging framework documentation not only through the web, but through different info...

متن کامل

A Formalization of Objects Using Equational Dynamic Logic

Order-sorted equational logic is extended with dynamic logic to a specification language for dynamic objects. Special attention is paid to different concepts of encapsulation that play a role in object-orientation. It is argued that the resulting language, CMSL, meets those requirements of the object-oriented database system manifesto [6] that are applicable to object-oriented conceptual models...

متن کامل

Context-Based Integrative Educational Technique in Profession-Oriented Foreign Language Teaching (Academic Model United Nations)

The aim of the article is to examine the Academic Model United Nations (Model UN) as a context-based integrative educational technique in profession-oriented foreign language teaching (FLT); to point out the context-based integrative nature of profession-oriented language learning and highlight the importance of using product-based educational techniques in FLT for developing students’ future p...

متن کامل

Modeling and Evaluation of Stochastic Discrete-Event Systems with RayLang Formalism

In recent years, formal methods have been used as an important tool for performance evaluation and verification of a wide range of systems. In the view points of engineers and practitioners, however, there are still some major difficulties in using formal methods. In this paper, we introduce a new formal modeling language to fill the gaps between object-oriented programming languages (OOPLs) us...

متن کامل

Modeling and Evaluation of Stochastic Discrete-Event Systems with RayLang Formalism

In recent years, formal methods have been used as an important tool for performance evaluation and verification of a wide range of systems. In the view points of engineers and practitioners, however, there are still some major difficulties in using formal methods. In this paper, we introduce a new formal modeling language to fill the gaps between object-oriented programming languages (OOPLs) us...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004